def mgcoord3d_str(self):
	return "(" + str(self.x) + ", " + str(self.y) + ", " + str(self.z) + ")"

def mgcoord3d_getitem(self, i):
	if i == 0:
		return self.x
	elif i == 1:
		return self.y
	elif i == 2:
		return self.z
	else:
		return None

def mgcoord3d_setitem(self, i, value): 
	if i == 0:
		self.x = value
	elif i == 1:
		self.y = value
	elif i == 2:
		self.z = value

def mgcoord3d_add(self, other):
	return mgCoord3dAdd(self, other)
	
def mgcoord3d_sub(self, other):
	return mgCoord3dSubtract(self, other)
	
def mgcoord3d_neg(self):
	return mgCoord3dNegate(self)
	
mgcoord3d.__str__ = mgcoord3d_str
mgcoord3d.__getitem__ = mgcoord3d_getitem
mgcoord3d.__setitem__ = mgcoord3d_setitem
mgcoord3d.__add__ = mgcoord3d_add
mgcoord3d.__sub__ = mgcoord3d_sub
mgcoord3d.__neg__ = mgcoord3d_neg